#include <iostream>
#include "../head/SortTestHelper.h"
// #include "../head/selectionSort.h"
// #include "../head/insertionSort.h"
//#include "../head/insertionSort2.h"
// #include "../head/bubbleSort.h"
// #include "../head/bubbleSort2.h"
#include "../head/shellSort.h"
// #include "../head/mergeSort.h"
#include "../head/quickSort.h"
#include "../head/quickSort3Ways.h"

using namespace std;

int main(){
	// print test result
	int a[10] = {10,9,8,7,6,5,4,3,2,1};
	// insertionSort(a,10);
	quickSort3Ways(a,10);
	SortTestHelper::printArray(a,10);

	// test function
	int n = 1000000;
	int *arr1 = SortTestHelper::generateRandomArray(n, 0, 10);
	// int *arr1 = SortTestHelper::generateNearlyOrderedArray(n,100);
	// int *arr2 = SortTestHelper::copyIntArray(arr1, n);
	// int *arr3 = SortTestHelper::copyIntArray(arr1, n);
	// int *arr4 = SortTestHelper::copyIntArray(arr1, n);
	// int *arr5 = SortTestHelper::copyIntArray(arr1, n);
	int *arr6 = SortTestHelper::copyIntArray(arr1, n);
	int *arr7 = SortTestHelper::copyIntArray(arr1, n);
	int *arr8 = SortTestHelper::copyIntArray(arr1, n);
	int *arr9 = SortTestHelper::copyIntArray(arr1, n);
	int *arr10 = SortTestHelper::copyIntArray(arr1, n);


	// SortTestHelper::testSort("Selection Sort ", selectionSort,arr1, n);
	// SortTestHelper::testSort("Insertion Sort ", insertionSort,arr2, n);
	// SortTestHelper::testSort("Insertion Sort2", insertionSort2,arr3, n);
	// SortTestHelper::testSort("Bubble    Sort ", bubbleSort,arr4,n);
	// SortTestHelper::testSort("Bubble2   Sort ", bubbleSort2,arr5,n);
	SortTestHelper::testSort("Shell     Sort ", shellSort,arr6,n);
	// SortTestHelper::testSort("merge     Sort ", mergeSort,arr7,n);
	// SortTestHelper::testSort("mergeBU   Sort ", mergeBU,arr8,n);
	SortTestHelper::testSort("quick     Sort ", quickSort,arr9,n);
	SortTestHelper::testSort("quickSort3Ways Sort", quickSort3Ways,arr10,n);

	delete[] arr1;
	// delete[] arr2;
	// delete[] arr3;
	// delete[] arr4;
	// delete[] arr5;
	delete[] arr6;
	// delete[] arr7;
	// delete[] arr8;
	delete[] arr9;
	delete[] arr10;

	return 0;
}

